Please post the code you need help with, or the algorithm you're using, and explain which part is causing you problems.