apple sample code for testing