documentation
first buggy refactoring version :)