Created a wpm function.
fixed merge conflict from wpm branch