added canvas and average method