CheckValidity.java altered.