cleanup, added assertions