Algorithm, add debug method and delete method