import of verctor and matrix stuff from apm