Added a function to read from a file