Add cs_filter_first_pos function