Added flagging system.
Added resource_events.