formatting code and adding testcase for #9