Added tail cutting and printing the general mining statistics.