DEHN’S ALGORITHM REVISITED, WITH APPLICATIONS TO SIMPLE CURVES ON SURFACES