add function to read file