This is substantially the same question as
this one. Let's continue over here, since you got answers already. If you have questions about those, feel free to ask for clarification.
Oh, and be aware that people here don't just hand out solutions, but will be happy to guide you to find your own.