imporved script