Reimplemented dependency resolution using breadth-first search