Update solution to sort linked list