Separate functions for syntax checking

Currently works with permutations of alphabet