Fixed Array function to return an array rather than a number.
Resolved duplicate variable assignment. Added final output.