findRelativePosition method coded