Added Delay routine and main loop for ReadPerformSubR program