#287 , adding documentation for the code