addFunction and removeFunction are added and tested.