if you want to get help here, you need to be specific. What exactly IS it doing, what exactly do you expect it do do, and how are they different?
I'd suggest you read much of
HowToAskQuestionsOnJavaRanch. You'll find many useful tips on the best way to post questions.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors