Updated code

Added template and updated the code of the application.