updated light stack code