Added better debug printing for total time taken