make pick() more general