added test cases; fixed ambiguity bug between states and compounds