canvas is cleared properly for redrawing and visualising continously works a lot smoother