- cleaned up the code
- added more tests