functions added for arrays