#4: fix ending wildcard
#4: add more test cases