updated sample.c