Added comments regarding new flags.
Optimized some of the new code.