got rid of unneeded junctions