Cleaned up the transform's inner working. Fixed some bugs. Added a rectangle implementation.