added index to p