private Component findCorrespondingComponent(Circuit circ, Component givenComp)
    {
        for (Component comp : circ.getComponents())
        {
            if ( (comp.getEndPt1().equals(givenComp.getEndPt1()) && comp.getEndPt2().equals(givenComp.getEndPt2())) || (comp.getEndPt1().equals(givenComp.getEndPt2()) && comp.getEndPt2().equals(givenComp.getEndPt1())) )
            {
                return comp;
            }
        }
        return null;
    }