implemented canvas functionality