MM, You're passing float point values to integers at some point? Be sure to be using superstrict in your code.
Ziggy, you are correct.
The problem is that i needed to do my division like this:
iscaleY = 768.0 / 329.0
what I was doing is this:
iscaleY = 768 / 329