https://www.classes.cs.uchicago.edu/archive/2015/spring/23500-1/hw3.html