Source: https://dspace.mit.edu/bitstream/handle/1721.1/104427/6-042j-spring-2005/contents/assignments/pset4_soln.pdf