Updated

Updated the algorithm and the reporting method