Adding End and Begin statements. Closing #23.
Removing unused func.