Added functionality for arrays and passing arrays