added depth to traverse