Changed critical sections to single sections.