Made function to read files