added a depth cap (and a config option for it)