flatten package