public void removeCarriage() throws TrainException {
		if (train.isEmpty()) {
			throw new TrainException("No rolling stock on the train.");
		}
		if (passengersOnTrain > NO_PASSENGERS) {
			throw new TrainException(
					"There are passengers on the train. No carriage shunting operations may be performed ");
		}

		// Removes the last carriage on the train
		RollingStock deleteCarriage = train.remove(train.size() - 1);

		boolean doneLookingFreight = false;
		boolean freightFound = false;

		// Goes through each carriage of the train
		for (int index = 0; index < train.size() && !doneLookingFreight; index++) {
			RollingStock temporaryRollingStock = train.get(index);
			if (temporaryRollingStock instanceof FreightCar) {
				// There is at least one freight carriage on the train
				freightFound = true;
				doneLookingFreight = true;
			}
		}
		if (!freightFound) {
			freightCarsExist = false;
		}

		// reduces the total number of seats on the train if a passenger car is
		// removed
		if (deleteCarriage instanceof PassengerCar) {
			trainSeatsAbility -= ((PassengerCar) deleteCarriage)
					.numberOfSeats();
		}

	}