Small modification in optimisation