working on test cases and debugging