Theory

An explanation of the theory can be found here.