cleaned up if statement that creates the panel list