Add an easy vectorizing function for arrays