unique and range functions