call me a nitpick, but maybe indent this and the y = lines a bit more, so it's clear that they're also defined as var's? Same with the other functions?