probably working but issue with drawing functions