Moving apple sample code