Added more documentation to code

fixed #6