merged algo branch

IMPORTANT!