File I/O changed to work with strings.