update hex calculation
remove console logs and add document ready