Add some custom distance function and features