added debug asserts for test