How to modifi code 12bit PWM to Timer3

Hi, how to modifi code: 12-Bit PWM on PIN9 using direct access to Timer1 - to Timer3 on PIN5
Arduino Mega 2560

Thank you

//12-Bit PWM on PIN9 using direct access to Timer1
//Fade in and out an LED connected to that pin

#define LEDValue OCR1A

const int PWMMax = 4095;
int value = 1;
int direction = 1;

void setup() { 
  pinMode(9,OUTPUT);
  
  TCCR1A = (1 << COM1A1) | (1 << WGM11);                // Enable Fast PWM on OC1A (Pin 9)
  TCCR1B = (1 << WGM13) | (1 << WGM12) | (1 << CS10);   // Mode 14 Fast PWM/ (TOP = ICR1), pre-scale = 1
  
  ICR1 = PWMMax;  //Set the TOP value for 12-bit PWM
  LEDValue = 0;      //Set the PWM output to full off.
}

void loop() {
  //Fade the LED between 0 and PWMMax and then back to 0
  value += direction;
  if (value <=0){
    direction = 1;
  }
  else if (value >= PWMMax){
    direction = -1;
  }
  LEDValue = value;
  delay(1);
}