Cleaned up the code a bit.
trying to get nested arrays to work.