add support for vertical/horizontal layout