Added comments

added comments and fixed minor syntax error to improve understanding and
help in algorithm dev.