Added Delay code