fixed isValid() to work on simple.txt test case