added skeleton of parameter optimisation function