Add some debug code to time things in the process