Move updatepath function to cw directory