Adding multi-ray support