light algorithm not work correct