Judge rules in favor of CVS