Now loopint input and printing statistics