Implementation of the sample_app tutorial example