used stringstream instead of to_string