The hammurabi code was written, so that crimes could be justified during the time period, an eye for an eye, a tooth for a tooth, basically in other words saying that if you were to steal a goat, you would then give a goat back to that person plus more . This was a justified lawith code to make peace with the community. Hope this helps, let me know if you have questions!