dynamic swapping of layout done