addd static to some functions to define the scope of their use, add the inline attribute to the static ones