pickFirst function