First version of automatic light, need to fix TODOs