improving script a little