added layout switching; fixed resizing; added panels removing