add max depth method

Issue #3