finished fixing advanced integer indexing