UPDATED VERSION OF HEX