sleep.c code condensed