Added more code for emitting and gathering photons