Added functionaity for arrays