renamed the to_string function