need help with 7-segment counter

I am using an arduino mega 2560 and 2 seven segment displays, i'm trying to get the displays to count down in 3 chunks from 20-0 seconds then 5-0 seconds and 30-0 seconds then repeat to go along with a traffic light controller. I have gotten it to count from 9-0 so far however both 7-segment displays count together 9-0 instead of being able to get the 10's place counter to count only every 10 seconds. Any help or suggestions would be welcomed.

//           ---A---
//          |       |
//          F       B
//          |       |
//           ---G---
//          |       |
//          E       C
//          |       |
//           ---D---
//
//        A = pin 22 & 47
//        B = pin 23 & 48
//        C = pin 24 & 49
//        D = pin 25 & 50
//        E = pin 26 & 51
//        F = pin 27 & 52
//        G = pin 28 & 53

byte seven_seg_digits[10][7] = { { 1,1,1,1,1,1,0 },  // = 0
                                                           { 0,1,1,0,0,0,0 },  // = 1
                                                           { 1,1,0,1,1,0,1 },  // = 2
                                                           { 1,1,1,1,0,0,1 },  // = 3
                                                           { 0,1,1,0,0,1,1 },  // = 4
                                                           { 1,0,1,1,0,1,1 },  // = 5
                                                           { 1,0,1,1,1,1,1 },  // = 6
                                                           { 1,1,1,0,0,1,0 },  // = 7
                                                           { 1,1,1,1,1,1,1 },  // = 8
                                                           { 1,1,1,1,0,1,1 }   // = 9
                                                           };
     

unsigned long previousMillis = 0; // sets previousMillis to 0
unsigned long currentMillis = 0;
const long interval = 1000; 
int count = 9;


void setup() { 
  // Tens Seven Segment Display
  pinMode(22,    OUTPUT); // A
  pinMode(23,    OUTPUT); // B
  pinMode(24,    OUTPUT); // C
  pinMode(25,    OUTPUT); // D
  pinMode(26,    OUTPUT); // E
  pinMode(27,    OUTPUT); // F
  pinMode(28,    OUTPUT); // G
  
  // Ones Seven Segment Display
  pinMode(47,    OUTPUT); // A
  pinMode(48,    OUTPUT); // B
  pinMode(49,    OUTPUT); // C
  pinMode(50,    OUTPUT); // D
  pinMode(51,    OUTPUT); // E
  pinMode(52,    OUTPUT); // F
  pinMode(53,    OUTPUT); // G
  
  ;
}
    
void sevenSegWrite1(byte digit) {                          // creates 7-segment variable
  byte pin = 47;                                          
 // start from pin 47 for the ones 7-segment
  for (byte segCount = 0; segCount < 7; ++segCount) {      
// set count to 0, count <7, +count 
    digitalWrite(pin, seven_seg_digits[digit][segCount]);  
// display on defined pin, the digit in the array based on position of count then move to next pin
    ++pin;
  }
}
void sevenSegWrite0(byte digit) {                          // creates 7-segment variable
  byte pin = 22;                                           
// start from pin 22 for the ones 7-segment
  for (byte segCount = 0; segCount < 7; ++segCount) {      // set count to 0, count <7, +count 
    digitalWrite(pin, seven_seg_digits[digit][segCount]);  
// display on defined pin, the digit in the array based on position of count then move to next pin
    ++pin;
  }
}

void loop() {
  
  currentMillis = millis();
  if(currentMillis - previousMillis >= interval) {  /
/ if currentMillis - previousMillis is greater than or equal to interval of 1000
                   previousMillis = currentMillis; 
                   sevenSegWrite1(count);
                   sevenSegWrite0(count);
                   count--;
                   if(count<0) count = 9;
                  

}
}

seven_segement_for_traffic_light.ino (3.22 KB)

// ---A---
// | |
// F B
// | |
// ---G---
// | |
// E C
// | |
// ---D---
//

I suggest theese changes
segm: abcdefg
dig 0: 11111110
1: 0110000
2: 1101101
3: pattern... and so on to 9

define an array containg the digits : byte digit[10]={B11111110,B110000,B......,,,,,all digits};

to write a digit to a 7segm: PORTA=digit[nbr]; // port A is pins 22..29, use DDRA to set port OUTPUT
(match segments to corresponding pins)
The other pin doesnt match a port.. Try to make it to! use port L or K

The procedure writing 2 digits can then be reduced to 2 lines of code!, and its fast!
Ensure R large - limit current to 10mA

Tens = number to be output/10 (Ints ignore fractions)
Units = number to be output modulo 10 (see % in Reference)