completed the to_string() method