Added maxdepth param