modified for test cases