Create W-function, and setup 2-phase