Added matrix operations functions.