Fixed some indexing bugs in the solveWeights function. Unfortunately I can't fully test yet cause I'm restricted to the stupid trial version of cplex