added fromHex, setHex, getHex, and small bugfixes