did some experiments with embedded for-loops. Found a add-all-the-elements sample for adding the array on stackoverflow, will try to use that as a sample.