Changed p2 to index