use millis() instead of delay() function