Fixed bugs, and implemented the transformation functions properly.