added functionality to read file; added test to read file