satisfying all the test cases and modifications in calling methods