Besides the link that JRA gave, there's a couple others
here that you might want to look at - Rules to Wire By and LabVIEW Programming Techniques - The Good, The Bad, and the Ugly. Also, one thing I noticed in your sample code, when you do need to use a for loop, you don't need to specify a number to the N terminal when you are autoindexing an array input.