improved performance with raycast