Fixed a documentation mistake.
Simplified code.
Changed comment.
Renamed boolean flags.