Replaced pointers with indices.