trying to port sort on linked list