https://courses.grainger.illinois.edu/ece342/fa2019/secure/Homeworks/hw7_sol.pdf