Implemented sum for linked list.