allow specifying the depth to trace back