got greedy grammar search working