Tweaked to include light sensor