use URI.join, added comments