Added supoort for trials parameter