WM function

WM model building