Added small hack to account for the the coordinate mapping to the screen, which inverts y.