Working now with condition variables