reads in from file and outputs