cleanup magic numbers for inverted coordinate (flipped screen)