Added an initialzation function
Added a termination function