worked on String input and output.