added matrix rotation