adds change directory and alters locating function