newNode Inst t p =  do (Digraph ns es) <- getGraph
                       let ks = keys ns
                           newNode = Node (newId ks) t p
                           newGraph = Digraph (M.insert (newId ks) newNode ns) es
                       putGraph newGraph
                       return $ newId ks -- thank you, lazyness

-- | Creates a new edge on the selected target
newNode Inst t p =  do (Digraph ns es) <- getGraph
                       let ks = keys ns
                           newNode = Node (newId ks) t p
                           newGraph = Digraph (M.insert (newId ks) newNode ns) es
                       putGraph newGraph
                       return $ newId ks -- thank you, lazyness

-- | Creates a new edge on the selected target
newNode Inst t p =  do (Digraph ns es) <- getGraph
                       let ks = keys ns
                           newNode = Node (newId ks) t p
                           newGraph = Digraph (M.insert (newId ks) newNode ns) es
                       putGraph newGraph
                       return $ newId ks -- thank you, lazyness

-- | Creates a new edge on the selected target