added scale factor and rotation control