Added unpackArrayFold function and rewrote unpackList function using it.