added docstring for extract_results method
replaced while loop with for loop construction