added delay.R