added assert statements