private AlgebraicParticle multiply(AlgebraicParticle a, AlgebraicParticle b) {
		//if a is a fraction and b is the bottom of that fraction
		if(a instanceof Fraction && ((Fraction)a).getBottom().equals(b)) {
			Fraction frac = (Fraction) a;
			//return the top of the fraction, making sure it's got the right sign
			return frac.getTop().cloneWithNewSign(a.sign() == frac.getTop().sign());
		}
		//if a is a term add b to the end of it
		else {
			ArrayList<AlgebraicParticle> aList = new ArrayList<AlgebraicParticle>(), bList = new ArrayList<AlgebraicParticle>();
			if(a instanceof Term && a.exponent() == 1) aList = ((Term)a).toList();
			else aList.add(a.cloneWithNewSign(true));
			if(b instanceof Term && b.exponent() == 1) bList = ((Term)b).toList();
			else bList.add(b.cloneWithNewSign(true));
			aList.addAll(bList);
			return new Term(a.sign() == b.sign(), aList, 1);
		}
	}