fix assert, add comments