I say get the algo then build yourself it will be easy for you to debug.
And please wrap your post in [code] tags