add matrix/vector functions