(almost) stable version: doens't stop at end