dynamic flex value and heirarchical layout