added code to draw canvas