Made isInputValid() nice and readable for Liam