Added sleep function and tester'