added some testcases including one that handles #17