debug and update sample routines
VF: update sample programs