tidied oct/hex conversions