added some printing to sample