added some stuff from other package adaptation of lshkit