small fix
New algorithm