working on stop_and_wait