made helper funtion drawCursor()