Defense Algorithm