added source code for sample applications