added a new parser for 2nd grammar
improved formula class
some fixes and improvements