Adding first part of condition variables, more to come.