Improved mission1 and mission3 goal function.