Made changes asked in review by timo

- Modified for Python 3 compatibility
- Added documentation.