removed some bugs, assertions