General change of rule from setting current directory to storing the wolfdir in a variable. Some cleanup done too