unelegant implemntation of sorted add on linked list