rotate an matrix by 90 degrees