some code with depth and maxpages