first init (not a great one) + verified cost function