getmetrics fxn, depth argument in fromJSON wasnt working