PROBLEM needs to be fixed cf note circa line 142