added the 'static' keyword to inline functions to keep gcc happy