some fixes, working out indexing strategy