fixed printTable()