depth variable used for stopping
pretty json printing