Gkogkos 11/7 version -- impled sem timedwait and some stat shit