added 2d functions, for doing image editing