Minor Changes to the code for taking the number of resuts