tweaked delay calculation