added loop for drawing