Modified light sensing code for our experiment