Added half-open mode