test and sample code