program now counts number of / before ' and decides whether that's the end of the link