Adding Aggregate Functionality and handling the zero record case