Added canvas clearing function.