updated to read file