- modularized code
- added exceptions
- added tests