By putting the length check first, the substring search is skipped.  Things run wayyyy faster now :)