The first was really straight forward. The second was cool as we could do a breadth first search, taking account the edges of our growing basins.