Changed reading to use the yield keyword, fixed reading strings bug