update
well, one little type overflowing, indeterministic memory error, and it took me over half a day to find it... finally solved now!