refactor entire library for hex printing