Added dynamic4 (dynamic3 + rws). Also a bit of tidy up in terms of how
wgt variable is passed around
Added dynamic4 now