Delay calculation added