Starting algorithm implementation