use fmincg to do minimisation