Keypad is extremely intermittent when pressed. What am I doing wrong?

I'm trying to make a simple keypad that rotates a servo when a code is input. But right now I'm just trying to Serial Print when the buttons are pressed to confirm that they're working. Sometimes the buttons work, sometimes they don't. It seems random depending on how I'm holding the keypad. Here is a picture of what I've got so far and the code is below. Also I don't know why the LED is on. Here's the data sheet for the keypad. And I was also looking at this instructable for guidance. I feel like my resistors may be in the wrong place or the wires aren't connected to the keypad well.

#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
byte rowPins[ROWS] = {5, 6, 7, 8}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {2, 3, 4}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
void loop(){
  char key = keypad.getKey();
  if (key != NO_KEY){

Are your wires soldered to the keypad?

Are your wires soldered to the keypad?

No they're not. Do they need to be?


Alright, I'll try that! Thank you!