added edge checking to the extend_from_anchor function to initialize a word