add asserts. small beauty changes