sample code for app