Code imporved