updated drawing functions a bit