Added a function that takes in an Array