read the file, init structs