Read Using millis() for timing. A beginners guide for an introduction to using millis() for timing if you are not familiar with it.
The fact that you have several variables with numeric subscripts usually means that you could make more use of arrays to hold data and reduce code.