Added statistics and curve fitting functionality