updated script a bit