removed self intersection bug