public mainClass() {
		long startTime = System.nanoTime();
		//System.out.println("Time 1: " + (System.nanoTime() - startTime) / 1000000);
        Globals.getInstance().mainFrame = this;
		Globals.getInstance().listsPacks = this;
        Globals.getInstance().initializeFolders();
        Globals.getInstance().loadPreferences();
		long tempTime = System.nanoTime();
        Globals.getInstance().updateListings();
		System.out.println("Perm listings update took: " + (System.nanoTime() - tempTime) / 1000000);

		this.setTitle("Permissions Checker v 1.2.6"); // Set the window title
		this.setPreferredSize(new Dimension(1100, 600)); // and the initial size

        JPanel leftPanel = new JPanel();
        leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));

        modPacksModel = new SortedListModel<>();
        loadPacks(Globals.getInstance().preferences.saveFolder);

        modPacksList = new NamedScrollingListPanel<>("ModPacks", 200, modPacksModel, true);
        modPacksList.setAlignmentX(Component.LEFT_ALIGNMENT);

        modPacksPanel = new ModPacksPanel(modPacksList);
		Globals.getInstance().addListener(modPacksPanel);
		updatePanel = new UpdatePanel();
		Globals.getInstance().addListener(updatePanel);
		permissionsPanel = new PermissionsPanel();
		Globals.getInstance().addListener(permissionsPanel);
		updatePanel.permPanel = permissionsPanel;

        modPacksList.addListener(new NamedScrollingListPanelListener() {
            @Override
            public void selectionChanged(NamedSelectionEvent event) {
                if(oldSelection != null && oldSelection.equals(modPacksList.getSelected())) return;
				Globals.getInstance().setModPack(modPacksList.getSelected());
                oldSelection = modPacksList.getSelected();
				modPacksList.revalidate();
            }
        });
		modPacksList.setSelected(0);
        leftPanel.add(modPacksList);

        this.add(leftPanel, BorderLayout.LINE_START);
		
		tabbedPane = new JTabbedPane();

        tabbedPane.add("Info", modPacksPanel);
        tabbedPane.add("Update", updatePanel);
		tabbedPane.add("Permissions", permissionsPanel);

		this.add(tabbedPane);


		JMenuBar menuBar = new JMenuBar(); // create the menu
		JMenu menu = new JMenu("Temp"); // with the submenus
		menuBar.add(menu);

        JMenuItem updatePerms = new JMenuItem("Update Permissions");
        updatePerms.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                Globals.getInstance().updateListings();
				permissionsPanel.invalidateContents();
            }
        });
        menu.add(updatePerms);

		JMenuItem newPack = new JMenuItem("Add pack");
		newPack.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				addPack();
			}
		});
		menu.add(newPack);

		JMenuItem newPackFromCode = new JMenuItem("Add pack from code");
		newPackFromCode.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				String code = JOptionPane.showInputDialog(
						Globals.getInstance().mainFrame, "Pack code", "Add pack",
						JOptionPane.PLAIN_MESSAGE);
				if(code == null || code.length() <= 0) return;

				ModPack temp = FileUtils.packFromCode(code).get(0);
				if(temp == null) {
					System.out.println("Couldn't find code");
					return;
				}
				System.out.println("Adding pack "+temp);
				temp.key = code;
				addPack(temp);
			}
		});
		menu.add(newPackFromCode);

        JMenuItem openFolder = new JMenuItem("Open appdata");
        openFolder.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                if(!OsTypes.getOperatingSystemType().equals(OsTypes.OSType.Windows)) {
                    System.out.println("Os is not windows, can't open explorer");
                    return;
                }
                try {
                    Desktop.getDesktop().open(Globals.getInstance().appStore);
                } catch (IOException e) {
                    System.out.println("Couldn't open explorer");
                    return;
                }
            }
        });
        menu.add(openFolder);

        JMenuItem drastic = new JMenuItem("Drastic click here");
        drastic.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent arg0) {
                JOptionPane.showMessageDialog(Globals.getInstance().mainFrame,
                        "More ram has been downloaded to your system.\nHave a nice day.");
            }
        });
        menu.add(drastic);

		this.setJMenuBar(menuBar);


		pack();
		setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
		setVisible(true);

		long endTime = System.nanoTime();
		System.out.println("Startup took: " + (endTime - startTime) / 1000000);
	}