Adjusted version of Hex Fractions from Denver that works with all nonrepeating