added first and last buttons for participants and added modulus check for last