better url shortening function.