Changed the jsonparser to accept a depth variable