changed contracts.assert to debug.assert