there was a bug causing objective functions to not be formulated properly if there was a sum() in the function. Data values were also bugging out. Fixed it and added tests.