start algorithm