public ListNode insertionSortList(ListNode head) {
        if(head == null || head.next == null) return head;

        ListNode dummy = new ListNode(Integer.MIN_VALUE);
        ListNode curr = head;

        while(curr != null){
            ListNode prev = dummy;
            ListNode next = curr.next;

            while(prev.next != null && prev.next.val < curr.val){
                prev = prev.next;

            }
            curr.next = prev.next;
            prev.next = curr;
            curr = next;
        }
        return dummy.next;
    }