added packet ray generation