made a simple if else query for flags and bools to check which was set