Opted for a simpler (to read) implementation to find dependencies.