updated lighting algorithm to stop light bending around corners