squash nested arrays better