added final flag for junctions extraction