fixed error in index; more cleanup