renamed replace_element back to replace_edge
added reject message handling
added accept message handling