code modification for various testcases