Created functions for summing each row.