p0 and p1 can be const