Finish get hex function