adding uint32 to save memory
major refactoring volknnsearch
fix (but not complete) for corresp2disp