code to read file