Added an array variable

Array variable uses if/else, a nested for loop and the array method
produces a return array. Also added local variable to perform a return
number to the main code.