working principle of optical sorting