Work in progress for lighting algorithm