Add assert and some comments