added test functions and examples