System.err.println("player " + p.toString() + " tries to remove track of " + currentTile.getOwner() + ", " + currentTile);
    private MoveStatus tryMove(World w, TrackPiece oldTrackPiece,        TrackPiece newTrackPiece, FreerailsPrincipal p) {        //Check that location is on the map.        if (!w.boundsContain(location.x, location.y)) {            return MoveStatus.moveFailed(                "Tried to build track outside the map.");        }	FreerailsTile currentTile = 	    (FreerailsTile)w.getTile(location.x, location.y);System.err.println("player " + p.toString() + " tries to remove track of " +	currentTile.getOwner() + ", " + currentTile);	if (! currentTile.getOwner().equals(trackOwner))	    return MoveStatus.moveFailed("You don't own this track");        //Check that the current track piece at this.location is        //the same as this.oldTrackPiece.	TrackPiece currentTrackPieceAtLocation = currentTile.getTrackPiece();        TrackRule expectedTrackRule = oldTrackPiece.getTrackRule();        TrackRule actualTrackRule = currentTrackPieceAtLocation.getTrackRule();        if (!expectedTrackRule.equals(actualTrackRule)) {            return MoveStatus.moveFailed("Expected '" +                expectedTrackRule.getTypeName() + "' but found '" +                actualTrackRule.getTypeName() + "' at " + location.x + " ," +                location.y);        }        if (currentTrackPieceAtLocation.getTrackConfiguration() != oldTrackPiece.getTrackConfiguration()) {            return MoveStatus.moveFailed(                "Unexpected track piece found at location: " + location.x +                " ," + location.y);        }        //Check that oldTrackPiece is not the same as newTrackPiece        if ((oldTrackPiece.getTrackConfiguration() == newTrackPiece.getTrackConfiguration()) &&                (oldTrackPiece.getTrackRule() == newTrackPiece.getTrackRule())) {            return MoveStatus.moveFailed("Already track here!");        }        //Check for illegal track configurations.        if (!(oldTrackPiece.getTrackRule().trackPieceIsLegal(oldTrackPiece.getTrackConfiguration()) &&                newTrackPiece.getTrackRule().trackPieceIsLegal(newTrackPiece.getTrackConfiguration()))) {            return MoveStatus.moveFailed("Illegal track configuration.");        }        //Check for diagonal conflicts.        if (!(noDiagonalTrackConflicts(location,                    oldTrackPiece.getTrackGraphicNumber(), w) &&                noDiagonalTrackConflicts(location,                    newTrackPiece.getTrackGraphicNumber(), w))) {            return MoveStatus.moveFailed(                "Illegal track configuration - diagonal conflict");        }        int terrainType = w.getTile(location.x, location.y)                           .getTerrainTypeNumber();        TerrainType tt = (TerrainType)w.get(KEY.TERRAIN_TYPES, terrainType);        if (!newTrackPiece.getTrackRule().canBuildOnThisTerrainType(tt.getTerrainCategory())) {            String thisTrackType = newTrackPiece.getTrackRule().getTypeName();            String terrainCategory = tt.getTerrainCategory().toLowerCase();            return MoveStatus.moveFailed("Can't build " + thisTrackType +                " on " + terrainCategory);        }        return MoveStatus.MOVE_OK;    }