Wrote the method isSubbag but did not test it yet.