Added trainer parameter.