Fixed the bug in the lab-algorithm constrainst