Update hex.cpp