How do you go about allocating the data for a struct like below properly (tried adding comments for clarity but been up far too many hours so apologies if they make little t