Changed sleep() to take a double so that you can pass in fractions of a
second