Added a function to parse hexadecimal value (crashed on fail)