Introduces sleep function