Implementation of the PAWL algorithm