In the future please wrap your code in the code tags to make it easier to read.
What part are you stuck on exactly? What are you not able to figure out?