read from file and put to struct