Updated some comments and replaced for loop with for each loops in Processing code