What have you tried so far?
Did you use a debugger to step through your code and see if you are missing something?