Credit goes to Mike Goldin for his pioneering work on the subject. Read his original articles here.

Please provide feedback in the comments if there are any corrections or improvements!