added some test code and examples