new functions insertArray and updateArray
needs work...