Changed the logic of the algorithm. Just keeping SV, and other auxiliar quantities.. Compiled and run without problems