added functionality for flags