Added shearing and reflection function.