how do i replace delay with millis in this code