added some to_i and to_f functions