Added additional comments and style to code