Finish flagging functionality