improved assertions as suggested