Converting test to sample program