added a boolean for drawing or not drawing (erasing)