changed some assert statements for clarity