Adding critical sections.