you have two void loop functions. You only need, or more so, must only have one. Also, once you combine the two, you will need to tweak the code, otherwise what will happen is first your red and blue lights alternate (first blue, then red), and only once they stop flashing, the headlights alternate once, then they will stop and wait for the red and blue lights to flash through the sequence. I am guessing you want the two to occur parallel to each other, which is doable, but it wont happen if you just throw the contents of your second loop function into the end of the first one.