factor out typedefs
factor out distance metrics
update benchmark script