using ds.js library for hashmap and set data structure
enhanced collision draft with a correct splitting rule