Implements isValid
Enough hacking to get to 29%