add matrix rotation algorithm.