Added the depth function