Better order, add some docs
Split indexing into a separate method