Add docs to all functions
Add more tests