Separated functions

Separated for loop into a function, returning array then bulk saving that array. Attempt deploy to Parse.