Created function to read from file