added cross-correlation function
edited special case of optics
example code of optics on triggers