updated main loop to not duplicate hash key