Waterfall

* Improved documentation
* Split code into smaller pieces
* Removed some unused code
* Made the syntax more in line with the community standard