Reorg matlab code to simulate shading