added matrix rotation and translation code