I know the feeling :) FYI this will only be accurate while your origin point is set to left. If it was centre and you wanted to get the xy of the right end still you would multiply by branch.width/2, although for your current purposes it seems unlikely you would move the origin from left.