Improving the execution time, and adding statistics output at the server