add definition of protocol and function