Reorg and syntax checking.  See #2