added time limit to expression evaluation
implemented inside out algorithm for fitting grammar production weights