finished implementing cws