def insert_at_index(rootllist, newllist, index):
  """ Insert newllist in the llist following rootllist such that newllist is at the provided index in the resulting llist"""

  # At start
  if index == 0:
    newllist.child = rootllist
    return newllist

  # Walk through the list
  curllist = rootllist
  for i in range(index-1):
    curllist = curllist.child

  # Insert
  newllist.last().child=curllist.child
  curllist.child=newllist

  return rootllist