Removed excess functions, added comments.