Added some documentation in  the code