The to_int and from_int functions