speed up p-1 method.