1. Tested all test cases. 2. Included functions and modifications to accommodate query H