In my code I'm using a float variable, and you are using an integer, that's probably why.