rewrote sleep.c