BACKUP: Algorithm still missing some parts