program outputs a messed up table, but with the right info