added ambient light & testing mode