- add documentation
- rename some variables