testing out timeval functionality, and trimmed down synchro_wait
there are errors apparent here, memory leaking