Source: https://clas.iusb.edu/math-compsci/_prior-thesis/SKhodali_thesis.pdf