Added comments

See comments in code.