You could use the array length in your loop so even if you change the array size the code will not cause an error.
for(int i = 0; i < genpart.length; i++) {
You could use the array length in your loop so even if you change the array size the code will not cause an error.
for(int i = 0; i < genpart.length; i++) {