handle case where p is infinity