Added the functions necessary for light sensing