fix up sample; and improve arg calling