Changing the prints into string building.