Added an enumeration algorithm based on Phong Nguyen's pseudocode