sketching the objective function framework. needs more work