needs a comment. why is it checking for a depth of only 1?