Added in all the code for arrays