all compiled, not tested yet, modified the hash insertion and its management