fixed tag comparison, added test, wip on further integration tests