some improvements; renames (x, y, z) -> (rx, ry, rz).