Added stop function and some code to test project.