Added code for finding averages by reducing & combining keys