Fixed bug in hash, simulation now appears to work as expected