very simple cost function, terrible performance, but working