I'd encourage using a more descriptive variable name than cwp.  I can see what the code does, but I've not idea what cwp stands for or is supposed to represent.