Little readability improvements.
Fixes the transformation matrix.
Implemented the record/replay feature.