merged mledford's ray tracing optimization