public static Formula applyForward(List<Formula> premises) throws BadPremises {
		if(premises.size() != 2) {
			System.out.println(premises);
			throw new BadPremises();
		} else {
			Formula a = premises.get(0);
			Formula b = premises.get(1);
			Implies pIq;
			Formula p;
			
			if(a.getClass().equals(Implies.class)) {
				pIq = (Implies) a;
				p = b;
			} else if(b.getClass().equals(Implies.class)) {
				pIq = (Implies) b;
				p = a;
			} else {
				throw new BadPremises();
			}
			
			if(pIq.left().equals(p)) {
				return pIq.right();
			} else {
				throw new BadPremises();
			}
		}
	}