Added validation for input and Hexadecimal system