Changed the get_independencies function