New compact dynamic algorithm