read file and assign values