added support for -u
fixed pointless code in hex case
changed how command line parameters are processed