reads in file and reads minimum
refactored to make less weather specific