Updated simulation to count flags and items