Modified doctest of p function in order to pass the test