Added hash function, tests are needed.