copied some sample code for testing