Not sure if anyone can help but I am new to arduino and C programming and Im trying to make a basic program that has 2 buttons and 2 LEDS.

This is what I want to do:

If I press Button1, L1 is ON and goes to function next()
if I press Button2, L2 is ON with L1, waits 2 seconds then turns both off and returns to the beginning of the loop.

I have tried it and only L1 comes on when Button1 is pressed and goes to the next() function but doesnt turnon L2 when Button2 is pressed and the rest of the code.

Can anyone tell me whats wrong please?

int L1 = 13;
int stateofL1 = L1;
int L2  = 12;
int Green = 11;
int Button1 = 7;
int Button2 = 6;

void setup()
  pinMode(L1, OUTPUT);
  pinMode(L2, OUTPUT);
  pinMode(Button1, INPUT);
  pinMode(Button2, INPUT);

void loop()
   int Press1 = digitalRead(Button1);
   int Press2 = digitalRead(Button2);
   if(Press1 == HIGH)
     digitalWrite(L1, HIGH);

void next()
  int Press2 = digitalRead(Button2);
  if(Press2 == HIGH)
    digitalWrite(L2, HIGH);
    digitalWrite(L1, LOW);
    digitalWrite(L2, LOW);