Minimize lambda instead of lambda square in ContactTask.