Replace delay function with millisDelay