let to_character_list s = let res = ref [] in for i = length s - 1 downto 0 do res := (B.get s i) :: !res done; !res