adding flags based on code names