Improves the documentation and makes some changes to the API