module for matrix-calculation