removed the delays in the code