rewrote the W*all() function to accept an additional argument holding