Program now runs with conditional variables on mutexs