Revert "Change dist function to use sklearn metrics"

This reverts commit 28abe651f3405a910eb5ac8800e3e588600a5bcd.
Clean up detection loop and normalizations