Cost function v2

September 16, 2018