Added shading function and matrix rotation function