Modifications on detect_fct.c, distances calculated with sqrt formula and and a fucking error on incrementation fixed