better input, stat output, minor changes