Removed unecessary code, added comments.