changed mb function to wc