added basic summary and flag functionality