Renamed variables for clarity
Added mapReduce()
Using mapReduce() internally