Added the testcases to D6 and modified slightly