Summary function working as it should