added faster shadow algorithm