cleaned up vector math, removed unused function