public int[] add(int[] x, int[] y) {
		// Determines the max degree.
		int maxDeg = Math.max(x.length, y.length);
		int[] sum = new int[maxDeg];
		if ( x.length < y.length ) {
			for ( int i = 0; i < x.length; i++ ) {
				sum[i] = (x[i] + y[i]) % p;
			}
			for ( int i = x.length; i < y.length; i++ ) {
				sum[i] = y[i];
			}
		} else { // x.length >= y.length
			if ( y.length < x.length ) {
				for ( int i = 0; i < y.length;  ) {
					sum[i] = (x[i] + y[i]) % p;
				}
				for ( int i = y.length; i < x.length; i++ ) {
					sum[i] = x[i];
				}
			} else { // x.length == y.length
				for ( int i = 0; i < x.length; i++ ) {
					sum[i] = (x[i] + y[i]) % p;
				}
			}
		}

		return simplify(sum);
	}