cartesian vector implementation