public boolean leavePage(JLabel j) {
   if (lastPage == trackLight) {
     sp2.leavePage();
     return true;
   } else if (lastPage == modelLight) {
     sc.setVisible(true);
     return true;
   } else if (lastPage == initLight) {
     if (j == null) {
       pi.checkAgentsExist();
       return true;
     } else if (!pi.checkAgentsExist()) {
       return false;
     }
   }
   return true;
 }