https://graphs.pythonprogramminghelp.com/how-to-create-the-perfect-invertibility/