Changed loop in randRangeUnique to include the max value