add dump algorithm