Added re-scheduling of rays