started working on moving to scipy.optimize.minimze(), so I don't have to have two separate functions for computing cost/grad