made reduce() an integer class method