Update validator.java

Additional methods and bugs in some methods fixed