hash map updating method written;ready for some tests