Solution to Hex Fractions (w/ code cleanup)