added file reading to main