add printout of statisc at the end