what are these?
why are "flags" needed? why not monitor a sensor and perform some action based on a sensor value?