samples and test code