Edit: Would just like to mention that it seems panels don't care about whether they're defined before or after functions that they might have to call, so pre-defining them isn't required. But, knowing how to do this will definitely be helpful in the future.