Improved documentation + tests