sorting layout elements by size or header