refactored the template
updated program text