Flag adding logic implemented, model updated