Added comments, removed unecessary code.