added support for rotation.