No one can help you if you don't post your code. If you don't know how, the following will get you sorted, though it's a bit long:
C