added minimisation of function of one variable