Fixed the calculation of percentiles and added --syntax and --algorithm options