Adds function sorted_ws_on_wd to sort WS array based on WD array