Improving debug output and adding execution time calculation.