Replaced wait/delivery flag with counters