Correcting #3 and adding testcases