added flagging system