add p to index