Removed dependency on external unhex function