showMessage method added, code indentation fixed