making dynamic sub layouts