port vector lib from firedoom
a mess