new version (after Fabrizio's proposal)