Add comments

Further expand the documentation in the code.