minFunc added