def returnMatches(a,b):
  """ A helper function to to return all indices of list a that have matches in list b.
  """
  new_list = []
  for index,element in enumerate(a):
    if element in b:
        new_list.append(index)
  return new_list