all the algorithms done!