almost working light calculation