Correction to take into account the lightFactor

Correction that applies to the previous pull request #239, on which the lightFactor was not being considered.