Renamed @flags to be more meaningful
Improved comments