Changes to Hex to make it more modular