modified code for wc