Added array.amend function
Added value checking on array functions