Simple logic, let me complete it. I bid this project because I want to work with you in future projects. I can complete this task for free. Contact me on skype ngcqunguyn or mail devteam113(at)gmail.com. If you have more projects, contact me, my team can handle many fields such as C, C++, C#, Java, matlab, algorithm, web, services, image processing, data mining,...