adds optional argument condition in get_independencies method