Pass array for custom function