fixed indexing, cleanup