Change sleepTime calculation