Bugfix

For P3 algorithm