passing array to function