recursively flatten/expand arrays for save/display