Show your code, or at least a pseudo-code attempt. We're not going to help you into a job where we have to perform your job for you every day.