Added to_char function