A temp version for switching layout

Still some errors.
Successfully switch between layouts

Not the perfect version but works now.