Revised GUI code to create different panels