Made main fun take canvas as argument