Changed functions names.
Implemented program exit.