private ActionListener research (final int i) {
		return new ActionListener() {
			public void actionPerformed (ActionEvent e) {
				if (researchupgrading.length() != 0) {
					JOptionPane.showMessageDialog(null, "You can only research one research at a time", "ERROR", JOptionPane.ERROR_MESSAGE);
					return;
				}
				if (i == 0 && checkresources(0, 0, 0, 0, 7 * (rml + 1))) {
					researchupgrading = "alloys";
					researchingseconds = 65 * (rml + 1);
					gold -= 7 * (rml + 1);
				} else if (i == 1 && checkresources(0, 0, 0, 0, 5 * (rfl + 1))) {
					researchupgrading = "agriculture";
					researchingseconds = 55 * (rfl + 1);
					gold -= 5 * (rfl + 1);
				} else if (i == 2 && checkresources(0, 0, 0, 0, 5 * (rql + 1))) {
					researchupgrading = "masonry";
					researchingseconds = 55 * (rql + 1);
					gold -= 5 * (rql + 1);
				} else if (i == 3 && checkresources(0, 0, 0, 0, 3 * (rwl + 1))) {
					researchupgrading = "woodcraft";
					researchingseconds = 45 * (rql + 1);
					gold -= 3 * (rwl + 1);
				} else return;
				researching = true;
			}
		};
	}