Remove unused functions
Remove unused import 'distance'
fix numpy broadcast shape error