The function keeps track of the previously installed rock, meaning we no longer need to manually keep track of the dependency chain. This will make adding or removing rocks much easier.