added option to enable TED computation for grid search