do task 2 (perfect hashing)