def buildTree(varDict, implications):
  """Returns tree of nodes to represent the logical model

  Args:
      varDict: a dictionary of strings representing all variables from the logical model
      implications: a list of string representing all implications from the logical model

  Returns:
      tree: a list of dictionaries each representing a node in the tree

  """
  tree = []
  for key in varDict:
    tree.append({"res":key[0:2], "row":int(key[3]), "col":int(key[4])})
  tree = sorted(tree, key=lambda i: i['row'])
  
  for node in tree:
    parents = []
    for implication in implications:
      if node == implication[0]:
        parents.append(implication[1])
    node["parents"] = parents
  return(tree)