Adding cost function without regularisation