Added functionality to read from a file