Added block to use custom distance measurements

To allow custom distance measures, it would be a nice idea to support a block upon initialization