added plugin functions and defines