supporting functions. need to support nested arrays.