Changed from reading from a file to reading from a string