added flip, mirror, rotate functions.