added a new, interesting function nanosleep with an optional input