major rework
fix all tests
improve documentation and add examples