Simulator control surface project- advice needed (lots of digital inputs)

void loop()
{
  if ((digitalRead(encA) == LOW) && (oldpinstate == HIGH))
    {
      oldpinstate = LOW;
      if (digitalRead(encB) == HIGH)
      {
        hdg++;
      }
      else
      {
        hdg--;
      }
      lcd.setCursor(13,1);
      sprintf(bufhdg, "%03d", hdg);
      lcd.print(bufhdg);
    }
   else
    {
      oldpinstate = digitalRead(encA);
    }

Could someone say if something is wrong with my code? (if it can cause my problems)