shortened url, tidied up long lines, added comment and test case