matrix multiplication added, vector multiplication changed @vjovanov