bug fix in ray and add connectedComponentRAY function