Working on matrix scalar product