Restructured the C libraries to manage output, interval tree ok first dimension but error to calculate dimension > 1, different number of matches to brute force