E: Made flag more generalized