wrote part of task1, but I didn't consider orthogonal matrices