added debug output with timing info