Added more sleep parameters
Deleted old function