flipped vertical axis in drawing code