select funtion used