refactor code and allow packet to understand hash addition