Partially finished cost function, failing Travis