improve Peter-Player algorithm