added the sign to the htoi function