def applyOrderList(order, aList):
  """ Apply order to aList.
  An order of the form [2,0,1] means that the first element
  should be the 3rd element of aList, and so on.
  """
  if order==[]:
    return aList
  else:
    return map(lambda v:aList[v], order)