proper array to function passing