Getting table indexing to work