replaced previous solution by improved one