Added pattern shading
Fixed logic error.