tweaked script a bit