Added comments and a few fixes
Comments and structured up the doc