fixed a lot of indexing stuff