Adding documentation, tests, and cleaned up code :)