alter p function