Implemented in-out algorithm for estimating grammar parameters