Adding End and Begin statements.