removed array_shift() nesting, thanks Hash::flatten()!