Adding inline documentation
Code clean up