fixed legalChar, fixed comparison, rewrote doTests again, reordered some tests