Golfed the script a bit