select unit function implemented