first compiling and working version after radical change of def use approach