got the mutex working and wrote code for cond