script now includes range functionality