Changes made to Josh's code in order to get it to work on a much larger dataset