Refactored to allow pushing of indeces