added some assert statements