Adding more documentation and tests