Getting output of if-then tables