- added documentation
- proper exception throwing