added simple 90° matrix rotation algorithm