Changed file reading to be more *pythonic*. Added comments