added hex funcs, options parsing