Last few things moved to functions or into functions.  Added a safety for addPanel, move css for Panel to outside addPanel condition to it happens regardless