divided code
add panel deletion