move min func into func for local scope; there will presumably be several in the same pkg