Note to self: Do not abbreviate your tile height variable and call it th. Because then you might have to search for it in your code. 190 hits, only 5 of them were the variable. The rest were this, Math, and width, as well as all the the, with, that, then ... in the comments.