patch adds a function
