fix #2 as well as adding new testcases