latest changes

reduced methods in mainLib and added validation.  Reworked helper method
and reworked parser.