Add panel switching code