Vulnerability fixes + new code and logic