LSH implementation