Actually I think it is a mistake to declare the first i out side the loop as an int. Why would anyone do that. Will try out a fix which seems more logical to me :D will keep you up to date!