added range functionality