There's some duplication here with `!parenRight && tempL.equals("")`. Could that be extracted into a variable for clarity?