finish the get_first_set function.

Signed-off-by: boddmg <boddmg@gmail.com>