changed Graphics type to Graphics2D