reads from file into proper data structures