replace function getDelays with function literals
replace function getDelays with function literals