moved definition of lightstate