slight modifications made to extract necessary data for second approach (no 10K restriction)