start of sampling method