Created comments for queryArray and some loops

Created comments for queryArray and looping through the array