moved delays from microseconds to milliseconds