https://courses.grainger.illinois.edu/ece486/fa2021/homework/assignments/hw3/hw03.pdf