Added flagging functionality.