added outputs to minFunc