small fix: rule F correctly constructs the variable now

also added some test cases and debugging print for unification