Change to the way minimum depth uses

Recursion! >_<