Added mouse control functions and matrix multiplications