Added the consistency checker function