remove opt.baseline line, it needs to be specified outised of function