public void map(LongWritable lineid, Text nodetxt,
                OutputCollector<Text, Text> output, Reporter reporter)
        throws IOException
		{
            Node node = new Node();
            node.fromNodeMsg(nodetxt.toString());

            int fdegree = node.degree("f");
			int rdegree = node.degree("r");
			float len = node.len() * node.cov();

            
            if ((len <= (float)TIPLENGTH) && (fdegree + rdegree <= 1) /*&& node.isUnique()*/)
			{
				reporter.incrCounter("Brush", "tips_found", 1);

				if ((fdegree == 0) && (rdegree == 0))
				{
					//this node is not connected to the rest of the graph
					//nothing to do
					reporter.incrCounter("Brush", "tips_island", 1);
				}
				else
				{
					// Tell the one neighbor that I'm a tip
					String linkdir = (fdegree == 0) ? "r" : "f";

					for(String adj : Node.dirs)
					{
						String key = linkdir + adj;

						List<String> edges = node.getEdges(key);

						if (edges != null)
						{
							if (edges.size() != 1)
							{
								throw new IOException("Expected a single edge from " + node.getNodeId());
							}

                            String edge_content = edges.get(0);
							String p = edge_content.substring(0, edge_content.indexOf("!"));

							if (p.equals(node.getNodeId()))
							{
								// short tandem repeat, trim away
								reporter.incrCounter("Brush", "tips_shorttandem", 1);
							}
							else
							{
								String con = Node.flip_dir(adj) + Node.flip_dir(linkdir);
								output.collect(new Text(p), new Text(Node.TRIMMSG + "\t" + con + "\t" + nodetxt));
							}
						}
					}
				}
			}
			else
			{
				output.collect(new Text(node.getNodeId()), new Text(node.toNodeMsg()));
			}

            reporter.incrCounter("Brush", "nodes", 1);
        }