Made changes that should hopefully handle scales and rotates.