Refactored into class for neatness
Created worker method for map multiprocessing