Changing perfectness check to direct method