First implementation of the P^2 algorithm