fix up some bugs. some more index